package Example;
//将一个数分解质因数

import java.util.Scanner;

public class Demo5 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请键入一个正整数: ");
        int n = scan.nextInt();
        int k = 2;
        System.out.print(n + "=" );
        while(k <= n) {
            if(k == n) {
                System.out.println(n);
                break;
            } else if(n % k == 0) {
                System.out.print(k + "*");
                n = n / k;
            } else k++;
        }
    }
}
